package io.kiki.sba.registry.common.model.slot;

import io.kiki.sba.registry.common.model.GenericResponse;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public final class SlotAccessGenericResponse<T> extends GenericResponse<T> {
    private SlotAccess slotAccess;

    public SlotAccessGenericResponse(boolean success, String message, SlotAccess slotAccess, T data) {
        this.slotAccess = slotAccess;
        this.setData(data);
        this.setSuccess(success);
        this.setMessage(message);
    }

    public static <T> SlotAccessGenericResponse<T> successResponse(SlotAccess access, T data) {
        return new SlotAccessGenericResponse(true, null, access, data);
    }

    public static <T> SlotAccessGenericResponse<T> failedResponse(SlotAccess access) {
        return new SlotAccessGenericResponse(false, access.toString(), access, null);
    }

    public static <T> SlotAccessGenericResponse<T> failedResponse(SlotAccess access, String msg) {
        return new SlotAccessGenericResponse(false, msg, access, null);
    }

    public static <T> SlotAccessGenericResponse<T> failedResponse(String msg) {
        return new SlotAccessGenericResponse(false, msg, null, null);
    }


}
